package com.entity;

/**
 * 扑克实体
 */
public class Poker implements Comparable {
    private Integer num;
    private TYPE_ENUM type;

    public Poker(Integer num, TYPE_ENUM type) {
        this.num = num;
        this.type = type;
    }

    public Integer getNum() {
        return num;
    }

    public void setNum(Integer num) {
        this.num = num;
    }

    public Poker.TYPE_ENUM getType() {
        return type;
    }

    public void setType(Poker.TYPE_ENUM type) {
        this.type = type;
    }

    @Override
    public int compareTo(Object obj) {
        Poker b = (Poker) obj;
        return this.getNum() - b.getNum();
    }

    @Override
    public String toString() {
        return "Poker{" +
                "num=" + num +
                ", type=" + type +
                '}';
    }

    public static enum TYPE_ENUM {
        黑桃(1), 红桃(2), 樱花(3), 方块(4);
        private int type;

        TYPE_ENUM(int type) {
            this.type = type;
        }
    }
}
